<template>
  <view class="page-order-detail">
    <van-cell-group>
      <van-cell title="运单编号" :value="'xxx'" size="large" />
      <van-cell title="运单金额" :value="'xxx'" size="large" />
      <van-cell title="运输方式" :value="'xxx'" size="large" />
      <van-cell title="计划发货时间" :value="'xxx'" size="large" />
      <van-cell title="发货地" :value="'xxx'" size="large" />
      <van-cell title="收货地" :value="'xxx'" size="large" />
      <van-cell title="装运说明" :value="'xxx'" size="large" />
      <van-cell title="备注" :value="'xxx'" size="large" />
    </van-cell-group>
    <view class="p-a-15">
      <view class="title title-v p-y-15">关联订单（2个）</view>
      <view class="fly-panel">
        <view class="hd"><text class="title">订单编号：00000</text></view>
        <view class="bd">
          <view class="bd-ul">
            <fly-info label="货主：" :value="'pageParams.lvtoReferralBillId'" />
            <fly-info label="货物：" :value="'pageParams.updateTime'" />
            <fly-info label="计划发货时间：" :value="'pageParams.payAmt'" /> 
            <fly-info label="发货地：" :value="'pageParams.payAmt'" /> 
            <fly-info label="收货地：" :value="'pageParams.payAmt'" /> 
          </view>         
        </view>
        <view class="ft flex-between">
          <view class="c-grey">2024-01-01</view>
          <view class="btn">
            <van-button type="info" size="small">详情</van-button>
          </view>
        </view>
      </view>
    </view>
    <view class="p-a-40"></view>
    <van-submit-bar
      class="submit-bar-no"
    >
      <view>待接单</view>
      <view>
        <van-button size="small">拒单</van-button>
        <van-button size="small" type="info" class="m-l-10">接单</van-button>
      </view>
    </van-submit-bar>
  </view>
</template>

<script>
import flyInfo from '@/components/flyInfo';
import flyUpload from '@/components/flyUpload';
export default {
  data(){
    return{
      pageParams: {},
      info:{

      },
      icon:{
        excel: this.$icon.excel,
        profile: this.$icon.profile,
        visittime: this.$icon.visittime,
      },
      list: [],
    }
  },
  components:{
    flyInfo,
    flyUpload
  },
  onLoad(e){
    this.pageParams = e;
    this.getList();
  },
  methods:{
    getList(){
      this.$http('get', '/lvto/lvtoReferralFollow/xcx/'+this.pageParams.lvtoReferralBillId,{}, (data,msg) => {
        if(data.length > 0){
          this.list = data.map(item => {
            item.imgList = [];
            return item;
          });
        }
      });
    },
    popupImg(i,list){
         uni.previewImage({
             urls: list,
             current: i,
             indicator: 0,
             loop: false
         })
    },
    writeDesc(item){
      uni.showModal({
        title: '填写病情描述',
        content: '',
        editable: true,
        success: res => {
          if(res.confirm){
            let params = {followId: item.followId, illnessDescribe: res.content};
            this.updateProcess(params);
            
          }else if(res.cancel){

          }
        }
      })
    },
    updateData(item){
        let arr = item.imgList.map(item => item.name);
        let params = {followId: item.followId, illnessData: arr.join(',')};
        this.updateProcess(params);
    },
    updateProcess(params){
      this.$http('put', '/lvto/lvtoReferralFollow/xcx/update', params , (data,msg) => {
        uni.showToast({title: '提交成功'});
        this.getList();
      })
    }
  }
}
</script>